<?php
header('Content-Type: text/html; charset=utf-8');
include("validar_usuario.php");
require_once("../control/Permissoes_control.php");

////////permissoes/////////
$permissao_control= new Permissao_control;
$permissao_menu_cadastro=$permissao_control->verificar(1,$codigo_user,$perfil_user);
$permissao_menu_relatorio=$permissao_control->verificar(2,$codigo_user,$perfil_user);

///////////////////////////////

$meio="home.php";
if(isset($_GET['path'])){
	$path=$_GET['path'];
	if($path=="home"){
		$meio="home.php";	
	}else if($path=="cad"){
		if(isset($permissao_menu_cadastro) && $permissao_menu_cadastro==1){
			$meio="cadastros.php";	
		}else{
			$meio="home.php";
		}
	}else if($path=="rel"){
		if($permissao_menu_relatorio==1){
			$meio="relatorios.php";	
		}else{
			$meio="home.php";
		}
	}else if($path=="boletos_avulsos"){
		$meio="boletos_ra.php";	
	}else if($path=="boletos_gerais"){
		$meio="boletos_gerais.php";	
	}else if($path=="boletos_filtro"){
		$meio="boletos_filtro.php";	
	}else if($path=="sair"){
		?><script>window.location= '../int/Login_int.php?acao=logout';</script><?php
	}
}


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css">
a:link {
	text-decoration: none;
	color: #666;
}
a:visited {
	text-decoration: none;
	color: #666;
}
a:hover {
	text-decoration: underline;
	color: #666;
}
a:active {
	text-decoration: none;
	color: #666;
}
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unicastelo - Sistema Online de Boletos</title>
<style type="text/css">

.rodape {
	color: #666;
	font-size: 12px;
}
</style>

<style type="text/css">
body {
	background:#000000;
	background-color:#FFF;
	background-image:url(../img/background-top.jpg);
	background-attachment: fixed;
	background-position:top center;
	background-repeat:no-repeat;
	font-family: Verdana, Geneva, sans-serif;
	font-size: 14px;
  }
  .titulo_top {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #333;
}
    .menus {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 12px;
	font-weight: bold;
}
    .menus_top {
	font-size: 12px;
	font-weight: bold;
	color: #CCC;
}
    .bem_vindo {
	font-size: 12px;
	color: #333;
}
    </style>
    <script language="javascript">
function alterar_senha_user(codigo) {
  window.open("../view/alterar_senha.php?&id=" + codigo,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,WIDTH=600,HEIGHT=400,top=50,left=50");
}
</script>

<script language="javascript" type="text/javascript" src="relogio.js"></script>

</head>
<body  >
<table width="978" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" align="right" valign="bottom">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="../img/LogoUnicastelo.png" width="301" height="47" /></td>
  </tr>
  <tr>
    <td align="left" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="titulo_top">Sistema Online de Boletos</span></td>
  </tr>
  <tr>
    <td height="20" align="right"><?php if(isset($_GET['path']) and $_GET['path']!="home"){?><table width="511" border="0">
      <tr>
        <td align="right"><span class="bem_vindo">Bem Vindo: <?php echo $nome_user." - Data: ".date('d/m/Y')." Hora:"; ?></span> </td>
        <td align="left" class="bem_vindo"><div id="relogio"><?php echo date("H:i"); ?></div></td>
      </tr>
    </table><?php } ?></td>
  </tr>
  <tr>
    <td height="40" align="center" valign="middle" class="menus_top"  background="../img/menu_034_c.jpg">
<a href="?path=home" class="current"><span class="menus_top">Inicio</span></a> <?php if($permissao_menu_cadastro==1){  ?>| 
		<a href="?path=cad"><span class="menus_top">Cadastros</span></a><?php } ?> |<?php if($permissao_menu_relatorio==1){  ?> 
		<a href="?path=rel"><span class="menus_top">Relat&oacute;rios</span></a><?php echo" |"; }  ?> <a href="javascript: alterar_senha_user(<?php echo $codigo_user;?>)" ><span class="menus_top">Alterar Senha</span></a> | <a href="?path=sair"><span class="menus_top">Sair</span></a>		</td>
  </tr>
  <tr>
    <td align="left" valign="top"><?php include $meio; ?></td>
  </tr>
  <tr>
    <td height="20" align="center" valign="middle" ></td>
  </tr>
  <tr>
    <td height="2" align="center" valign="middle"  >&nbsp;</td>
  </tr>
  <tr>
    <td height="40" align="right" valign="middle" >&nbsp;</td>
  </tr>
</table>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><span class="rodape">Unicastelo - Universidade Camilo Castelo Branco</span></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>